/**
 * @description 门面系统不处理业务逻辑，只是提供访问入口
 */

class ClassA {
  doSomethingA() {
    console.log('A逻辑');
  }
}
class ClassB {
  doSomethingB() {
    console.log('B逻辑');
  }
}
class ClassC {
  doSomethingC() {
    console.log('C逻辑');
  }
}

class Context {
  private _a: ClassA = new ClassA()
  private _c: ClassC = new ClassC()
  public complexMethod() {
    this._a.doSomethingA()
    this._c.doSomethingC()
  }
}

class Facade {
  private _a: ClassA = new ClassA()
  private _b: ClassB = new ClassB()
  private _context: Context = new Context()

  public methodA() {
    this._a.doSomethingA()
  }
  public methodB() {
    this._b.doSomethingB()
  }

  /**
   * @description 如果修改methodC逻辑，不在这里写
   */
  public methodC() {
    // this._c.doSomethingC()
    this._context.complexMethod()
  }
}


function main() {
  const facade = new Facade()
  facade.methodC()
}
main()

